﻿using LxCore;
using System;

namespace LxCFD
{
    class PhysicalPanelVM : BindableBase
    {
        public PhysicalPanelVM()
        {
            CreatePhysical = new DelegateCommand(() =>
            {
                var p = LxSim.Sim.Physics.CreatePhysicalModel();
                SelectedPhysical = p;
            });
            DeletePhysical = new DelegateCommand(() =>
            {
                LxSim.Sim.Physics.PhysicalModels.Remove(SelectedPhysical);
            });
        }
        public PhysicsCenter PhysicalCenter { get; } = LxSim.Sim.Physics;

        private PhysicalModel _SelectedPhysical;
        public PhysicalModel SelectedPhysical
        {
            get { return _SelectedPhysical; }
            set
            {
                _SelectedPhysical = value;
                RaisePropertyChanged(nameof(SelectedPhysical));
            }
        }


        public DelegateCommand CreatePhysical { get; set; }
        public DelegateCommand DeletePhysical { get; set; }

        private PhysicalTypes[] _PhysicalTypes = Enum.GetValues<PhysicalTypes>();
        public PhysicalTypes[] PhysicalTypes
        {
            get { return _PhysicalTypes; }
            set
            {
                _PhysicalTypes = value;
                RaisePropertyChanged(nameof(PhysicalTypes));
            }
        }
        public BuoyancyTypes[] BuoyancyTypes { get; } = new[] { LxCore.BuoyancyTypes.无, LxCore.BuoyancyTypes.Boussinesq模型 }; // Enum.GetValues<BuoyancyTypes>();


        private ConvectionSchemes[] _ConvSchemes = Enum.GetValues<ConvectionSchemes>();
        public ConvectionSchemes[] ConvSchemes
        {
            get { return _ConvSchemes; }
            set
            {
                _ConvSchemes = value;
                RaisePropertyChanged(nameof(ConvSchemes));
            }
        }
        private FlowTypes[] _FlowTypes = new[] { LxCore.FlowTypes.层流 };// Enum.GetValues<FlowTypes>();
        public FlowTypes[] FlowTypes
        {
            get { return _FlowTypes; }
            set
            {
                _FlowTypes = value;
                RaisePropertyChanged(nameof(FlowTypes));
            }
        }
        private TurbulenceTypes[] _TurbulenceTypes = Enum.GetValues<TurbulenceTypes>();
        public TurbulenceTypes[] TurbulenceTypes
        {
            get { return _TurbulenceTypes; }
            set { _TurbulenceTypes = value; }
        }

        private RadiationTypes[] _RadiationTypes = Enum.GetValues<RadiationTypes>();

        public RadiationTypes[] RadiationTypes
        {
            get { return _RadiationTypes; }
            set { _RadiationTypes = value; RaisePropertyChanged(nameof(RadiationTypes)); }
        }

    }
}
